<template>
	<view class="bgMinor2 pt-24 plr-24 pt-24" >
		<view style="margin-bottom: 60rpx">

			<view class="bgWhite plr-24 radius-16" style="padding: 20rpx;;min-height: 97vh;">
                 <view v-html="result"></view>
			</view>
		</view>
		
	</view>
</template>

<script setup lang="ts">
	// import { baseURL } from '@/utils/config.ts';
	import { reactive,ref } from 'vue';
	import { getWindowHeight } from '@/pages/util/getHeight';
	import { onLoad } from '@dcloudio/uni-app';
	import { get, post, baseConfig } from '@/utils/request';

	import { addOpen, loggedIn, addOpenTab } from '@/pages/util/hooks';
	import useLoginStore from '@/pinia-store/userInfoStore';
	const useLogin = useLoginStore();
	
	const { name } = withDefaults(
		defineProps<{
			name : String;
			// info: Array<T>;
		}>(),
		{
			name: () => '',
			// info: () => null // 复杂数据类型使用函数返回的方式
		}
	);
	// console.log('useLoginuseLogin',useLogin);
	const result = ref()
	onLoad((options : any) => { 
		 console.log(options)
		 onSubmit()
	});
	/** @name xxx */

	const onSubmit = async () => {
// 0:了解脉宇宙,1:用户服务协议,2:隐私政策，0 1 2可能是富文本 3：商家认证费用）
		try {
			let data = {
				type:name
			}
			uni.setNavigationBarTitle({
				title: name == 0 ? "了解脉宇宙" : name ==1 ? "用户服务协议" : name == 2 ? "隐私政策" : name == 7 ? "版权协议" : name == 8 ? "会员服务协议" : name == 9 ? "自动续费服务协议" : ''
			});
			const response = await get<{
				type : string;
			}>('/aiContent/getData', data);
			console.log(response)
			if(response){
				result.value = response.result
			}
			
		} catch (error) {
			console.error(error);
		}
	};
	
</script>

<style scoped lang="scss">
	// :deep(.checklist-box) {
	// 	//  模版
	// }

	:deep(.uv-upload__button) {
		margin: 0;
	}

	// 按钮
	.list_b_btn {
		background: -webkit-linear-gradient(left top, #ffc800, #ff0053, #ff5037); // , 100%,#ff5037 left top,
	}
</style>